<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<%@include file="../../common/taglib/taglib.jsp" %>
<%@include file="../common/dwz.jsp" %>
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="${baseURL}/dwz/images/loginuser.png" type="image/png">
    <title>预警阈值更新</title>
    <link href="${baseURL}/dwz/css/style.default.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/jquery.datatables.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/bootstrap-override.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/jquery-ui-1.10.3.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/weather-icons.min.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/animate.delay.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/animate.min.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/toggles.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/select2.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/lato.css" rel="stylesheet">
    <link href="${baseURL}/dwz/css/roboto.css" rel="stylesheet">

</head>


<body>

<!-- 左侧导航栏开始-->
<c:import url="../common/left.jsp"></c:import>
<!-- 左侧导航栏结束-->
<div class="mainpanel">

    <!-- 头导航栏开始-->
    <c:import url="../common/hander.jsp"></c:import>
    <!-- 头导航栏结束-->
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4 class="panel-title">预警阈值表修改</h4>
        </div>
        <div class="panel-body panel-body-nopadding">

            <input id="thresholdId" type="hidden" value="${threshold.id}">
            <div class="form-horizontal form-bordered">
                <div class="form-group">
                    <label class="col-sm-3 control-label">创建者:</label>
                    <div class="col-sm-6">
                        <input id="createBy" type="text" class="form-control" ${threshold.createBy} />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">创建时间:</label>
                    <div class="col-sm-6">
                        <input id="createDate" type="text" value="${threshold.createDate}"
                               class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">更新者:</label>
                    <div class="col-sm-6">
                        <input id="updateBy" type="text" value="${threshold.updateBy}" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">备注信息:</label>
                    <div class="col-sm-6">
                        <input id="remarks" type="text" value="${threshold.remarks}" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">删除标记:</label>
                    <div class="col-sm-6">
                        <input id="delFlag" type="text" value="${threshold.delFlag}" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">等级:</label>
                    <div class="col-sm-6">
                        <input id="level" type="text" value="${threshold.level}"
                               class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">数值:</label>
                    <div class="col-sm-6">
                        <input id="value" type="text" value="${threshold.value}" class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">类型:</label>
                    <div class="col-sm-6">
                        <input id="type" type="text" value="${threshold.type}"
                               class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">升级系数:</label>
                    <div class="col-sm-6">
                        <input id="ratio" type="text" value="${threshold.ratio}"
                               class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">设备位置:</label>
                    <div class="col-sm-6">
                        <input id="sensorPosition" type="text" value="${threshold.sensorPosition}"
                               class="form-control"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">范围标志:</label>
                    <div class="col-sm-6">
                        <input id="scopeFlag" type="text" value="${threshold.scopeFlag}" class="form-control"/>
                    </div>
                </div>
            </div>


        </div><!-- panel-body -->

        <div class="panel-footer">
            <div class="row">
                <div class="col-sm-6 col-sm-offset-3">
                    <button id="save" type="button" class="btn btn-primary">提交</button>&nbsp;
                    <button class="btn btn-default">返回</button>
                </div>
            </div>
        </div><!-- panel-footer -->

    </div><!-- panel -->

</body>


<script>

    $("#save").click(function () {

        debugger

        var id = $("#thresholdId").val();
        var createBy = $("#createBy").val();
        // var createDate = $("#createDate").val();
        var updateBy = $("#updateBy").val();
        // var updateDate = $("#updateDate").val();
        var remarks = $("#remarks").val();
        var delFlag = $("#delFlag").val();
        var level = $("#level").val();
        var value = $("#value").val();
        var type = $("#type").val();
        var ratio = $("#ratio").val();
        var sensorPosition = $("#sensorPosition").val();
        var scopeFlag = $("#scopeFlag").val();

        var data = {
            id:id,
            createBy: createBy, updateBy: updateBy,
            remarks: remarks, delFlag: delFlag, level: level, value: value,type:type,
            ratio: ratio, sensorPosition: sensorPosition,scopeFlag:scopeFlag
        };

        $.ajax({
            url: "/bizThreshold/update/",
            type: "POST",
            data: data,
            success: function (result) {
                debugger
                alert("修改成功")
                window.location.href = "/bizThreshold/threshold/1/${threshold.type}"
            },
            error: function (result) {
                debugger
                alert(1)
            }
        });

    })


</script>


</html>